home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Source Code / Visual Basic Source Code.iso / vbsource / bitblt / bitblt.frm < prev    next >
Text File  |  1995-12-05  |  10KB  |  410 lines

  1. VERSION 2.00
  2. Begin Form Form1 
  3.    Caption         =   "BitBlt Tester"
  4.    ClientHeight    =   5685
  5.    ClientLeft      =   810
  6.    ClientTop       =   1515
  7.    ClientWidth     =   9150
  8.    Height          =   6090
  9.    Icon            =   BITBLT.FRX:0000
  10.    Left            =   750
  11.    LinkTopic       =   "Form1"
  12.    ScaleHeight     =   379
  13.    ScaleMode       =   3  'Pixel
  14.    ScaleWidth      =   610
  15.    Top             =   1170
  16.    Width           =   9270
  17.    Begin ComboBox Combo1 
  18.       Height          =   288
  19.       Left            =   5520
  20.       Style           =   2  'Dropdown List
  21.       TabIndex        =   7
  22.       Top             =   360
  23.       Width           =   1932
  24.    End
  25.    Begin CommandButton Command3 
  26.       Caption         =   "EXECUTE BitBlt"
  27.       Height          =   492
  28.       Left            =   240
  29.       TabIndex        =   0
  30.       Top             =   2280
  31.       Width           =   3252
  32.    End
  33.    Begin CommandButton Command5 
  34.       Caption         =   "Hide"
  35.       Height          =   492
  36.       Left            =   2280
  37.       TabIndex        =   13
  38.       Top             =   960
  39.       Width           =   612
  40.    End
  41.    Begin CommandButton Command4 
  42.       Caption         =   "Draw Print Regions"
  43.       Height          =   492
  44.       Left            =   240
  45.       TabIndex        =   12
  46.       Top             =   960
  47.       Width           =   1932
  48.    End
  49.    Begin TextBox Text8 
  50.       Height          =   372
  51.       Left            =   4560
  52.       TabIndex        =   6
  53.       Text            =   "30"
  54.       Top             =   360
  55.       Width           =   612
  56.    End
  57.    Begin TextBox Text7 
  58.       Height          =   372
  59.       Left            =   3840
  60.       TabIndex        =   5
  61.       Text            =   "20"
  62.       Top             =   360
  63.       Width           =   612
  64.    End
  65.    Begin TextBox Text6 
  66.       Height          =   372
  67.       Left            =   2760
  68.       TabIndex        =   4
  69.       Text            =   "110"
  70.       Top             =   360
  71.       Width           =   612
  72.    End
  73.    Begin TextBox Text5 
  74.       Height          =   372
  75.       Left            =   2040
  76.       TabIndex        =   3
  77.       Text            =   "170"
  78.       Top             =   360
  79.       Width           =   612
  80.    End
  81.    Begin TextBox Text4 
  82.       Height          =   372
  83.       Left            =   960
  84.       TabIndex        =   2
  85.       Text            =   "10"
  86.       Top             =   360
  87.       Width           =   612
  88.    End
  89.    Begin TextBox Text3 
  90.       Height          =   372
  91.       Left            =   240
  92.       TabIndex        =   1
  93.       Text            =   "10"
  94.       Top             =   360
  95.       Width           =   612
  96.    End
  97.    Begin TextBox Text2 
  98.       Height          =   372
  99.       Left            =   6240
  100.       TabIndex        =   10
  101.       Text            =   "c:\windows\redbrick.bmp"
  102.       Top             =   3120
  103.       Width           =   2652
  104.    End
  105.    Begin TextBox Text1 
  106.       Height          =   372
  107.       Left            =   1320
  108.       TabIndex        =   8
  109.       Text            =   "c:\windows\leaves.bmp"
  110.       Top             =   3120
  111.       Width           =   2652
  112.    End
  113.    Begin CommandButton Command2 
  114.       Caption         =   "Loadpicture"
  115.       Height          =   372
  116.       Left            =   240
  117.       TabIndex        =   9
  118.       Top             =   3120
  119.       Width           =   1092
  120.    End
  121.    Begin CommandButton Command1 
  122.       Caption         =   "Loadpicture"
  123.       Height          =   372
  124.       Left            =   5160
  125.       TabIndex        =   11
  126.       Top             =   3120
  127.       Width           =   1092
  128.    End
  129.    Begin PictureBox Picture2 
  130.       Height          =   2052
  131.       Left            =   5160
  132.       ScaleHeight     =   135
  133.       ScaleMode       =   3  'Pixel
  134.       ScaleWidth      =   247
  135.       TabIndex        =   15
  136.       TabStop         =   0   'False
  137.       Top             =   3480
  138.       Width           =   3732
  139.    End
  140.    Begin PictureBox Picture1 
  141.       Height          =   2052
  142.       Left            =   240
  143.       ScaleHeight     =   135
  144.       ScaleMode       =   3  'Pixel
  145.       ScaleWidth      =   247
  146.       TabIndex        =   14
  147.       TabStop         =   0   'False
  148.       Top             =   3480
  149.       Width           =   3732
  150.    End
  151.    Begin Label Label8 
  152.       Caption         =   "Label8"
  153.       FontBold        =   0   'False
  154.       FontItalic      =   0   'False
  155.       FontName        =   "Courier"
  156.       FontSize        =   9.75
  157.       FontStrikethru  =   0   'False
  158.       FontUnderline   =   0   'False
  159.       Height          =   252
  160.       Left            =   240
  161.       TabIndex        =   23
  162.       Top             =   1920
  163.       Width           =   8652
  164.    End
  165.    Begin Label Label7 
  166.       Caption         =   "BitBlt Command"
  167.       Height          =   252
  168.       Left            =   240
  169.       TabIndex        =   22
  170.       Top             =   1680
  171.       Width           =   2772
  172.    End
  173.    Begin Label Label6 
  174.       Caption         =   "Destination"
  175.       Height          =   252
  176.       Left            =   5160
  177.       TabIndex        =   21
  178.       Top             =   2880
  179.       Width           =   1452
  180.    End
  181.    Begin Label Label1 
  182.       Caption         =   "Source"
  183.       Height          =   252
  184.       Left            =   240
  185.       TabIndex        =   20
  186.       Top             =   2880
  187.       Width           =   732
  188.    End
  189.    Begin Label Label5 
  190.       Caption         =   "Raster Operation"
  191.       Height          =   252
  192.       Left            =   5520
  193.       TabIndex        =   19
  194.       Top             =   120
  195.       Width           =   1932
  196.    End
  197.    Begin Label Label4 
  198.       Caption         =   "UpLeft of Source"
  199.       Height          =   252
  200.       Left            =   3840
  201.       TabIndex        =   18
  202.       Top             =   120
  203.       Width           =   1452
  204.    End
  205.    Begin Label Label3 
  206.       Caption         =   "Wid. && Ht. of Dest."
  207.       Height          =   252
  208.       Left            =   2040
  209.       TabIndex        =   17
  210.       Top             =   120
  211.       Width           =   1572
  212.    End
  213.    Begin Label Label2 
  214.       Caption         =   "UpLeft of Dest."
  215.       Height          =   252
  216.       Left            =   240
  217.       TabIndex        =   16
  218.       Top             =   120
  219.       Width           =   1332
  220.    End
  221. End
  222. Declare Function BitBlt Lib "GDI" (ByVal hDestDC As Integer, ByVal X As Integer, ByVal Y As Integer, ByVal nWidth As Integer, ByVal nHeight As Integer, ByVal hSrcDC As Integer, ByVal XSrc As Integer, ByVal YSrc As Integer, ByVal dwRop As Long) As Integer
  223. Const BLACKNESS = &H42
  224. Const DSTINVERT = &H550009
  225. Const MERGECOPY = &HC000CA
  226. Const MERGEPAINT = &HBB0226
  227. Const NOTSRCCOPY = &H330008
  228. Const NOTSRCERASE = &H1100A6
  229. Const PATCOPY = &HF00021
  230. Const PATINVERT = &H5A0049
  231. Const PATPAINT = &HFB0A09
  232. Const SRCAND = &H8800C6
  233. Const SRCCOPY = &HCC0020
  234. Const SRCERASE = &H440328
  235. Const SRCINVERT = &H660046
  236. Const SRCPAINT = &HEE086
  237. Const WHITENESS = &HFF0062
  238. Dim k As Long
  239.  
  240. Sub Combo1_Change ()
  241. combos
  242. End Sub
  243.  
  244. Sub Combo1_Click ()
  245. combos
  246. End Sub
  247.  
  248. Sub combos ()
  249. Select Case combo1.ListIndex
  250. Case 0
  251.     k = BLACKNESS
  252. Case 1
  253.     k = DSTINVERT
  254. Case 2
  255.     k = MERGECOPY
  256. Case 3
  257.     k = MERGEPAINT
  258. Case 4
  259.     k = NOTSRCCOPY
  260. Case 5
  261.     k = NOTSRCERASE
  262. Case 6
  263.     k = PATCOPY
  264. Case 7
  265.     k = PATINVERT
  266. Case 8
  267.     k = PATPAINT
  268. Case 9
  269.     k = SRCAND
  270. Case 10
  271.     k = SRCCOPY
  272. Case 10
  273.     k = SRCERASE
  274. Case 12
  275.     k = SRCINVERT
  276. Case 13
  277.     k = SRCPAINT
  278. Case 14
  279.     k = WHITENESS
  280. End Select
  281. filllabel
  282.  
  283. End Sub
  284.  
  285. Sub Command1_Click ()
  286. picture2 = LoadPicture(text2)
  287. End Sub
  288.  
  289. Sub Command2_Click ()
  290. picture1 = LoadPicture(text1)
  291. End Sub
  292.  
  293. Sub Command3_Click ()
  294. command5_click
  295. i% = BitBlt(picture2.hDC, Val(text3), Val(text4), Val(text5), Val(text6), picture1.hDC, Val(text7), Val(text8), k)
  296.  
  297.  
  298. End Sub
  299.  
  300. Sub Command4_Click ()
  301. command5_click
  302. picture1.DrawStyle = 0
  303. picture1.DrawWidth = 2
  304. picture1.Line (Val(text7), Val(text8))-(picture1.Width - 2, picture1.Height - 2), , B
  305. picture1.DrawWidth = 1
  306. 'picture1.Line